package xyz.syyrjx.blog.entity;

import xyz.syyrjx.blog._enum.State;

import java.util.Objects;

public class Types {
    private Long id;
    private String name;
    private Integer state;

    public Types(){}

    public Types(Long id, String name) {
        this.id = id;
        this.name = name;
        this.state = State.NORMAL_STATE.getCode();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "Type{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Types types = (Types) o;
        return Objects.equals(id, types.id) &&
                Objects.equals(name, types.name);
    }

}
